package com.qk.mapper;

import com.qk.entity.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleMapper {
    //查询角色列表
    List<Role> selectList(String name, String label) ;
    //根据ID删除角色
    @Delete("delete from role where id=#{id}")
    void delete(Integer id);
    //添加角色
    @Insert("insert into role(name,label,remark,create_time,update_time) " +
            "values(#{name},#{label},#{remark},#{createTime},#{updateTime})")
    void insert(Role role);
    //根据ID查询角色
    @Select("select id, name, label, remark, create_time, update_time from role where id=#{id}")
    Role selectByID(Integer id);
    //修改角色
    void upDate(Role role);
    //查询所有角色
    @Select("select id, name, label, remark, create_time, update_time from role")
    List<Role> selectAllList();
}
